/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.sql.ResultSet;
import java.sql.SQLException;

import database.DBNames;

/**
 *
 * @author falxa
 */
public class Doc 
{
    private int id;
    private String name;
    
    public Doc(int id, String name)
    {
        this.id = id;
        this.name = name;
    }
    
    public Doc(ResultSet rs)
    {
    	try
		{
			this.id = rs.getInt(DBNames.DOC_ID);
			this.name = rs.getString(DBNames.DOC_NAME);
		} catch (SQLException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    }
    
    public int getID()
    {
    	return this.id;
    }
    
    public String getName()
    {
        return this.name;
    }
    
    public StringBuilder toDBString()
    {
        StringBuilder toDB = new StringBuilder("(\""+this.id+"\", \""+this.name+"\"),");
        return toDB;
    }
   
}
